package torres.item.effect;

import torres.entity.Entity;

/**
 * @author Torres
 *An Effect that increases the mana of the specified Entity.
 */
@SuppressWarnings("serial")
public class RestoreManaEffect implements Effect {

	private int restoreValue;
	
	/**
	 * Create a new RestoreManaEffect with the specified value.
	 * @param restoreValue Amount of mana to restore to the player on use.
	 */
	public RestoreManaEffect(int restoreValue) {
		this.setRestoreValue(restoreValue);
	}
	
	/**
	 * Use this effect on the specified entity.
	 * @param The Entity that is using this item. 
	 */
	@Override
	public void use(Entity e) {

		e.incCurrMana(this.getRestoreValue());
	}
	
	/**
	 * Tests to see if this effect can successfully be applied to the specified Entity. 
	 * @param e The Entity on which to test if this affect can be applied.
	 * @return True if this effect can be applied to the Entity, false otherwise.
	 */
	public boolean canUse(Entity e) {
		return true;
	}
	
	/**
	 * Sets the amount of mana to be recovered on use.
	 * @param restoreValue The amount of mana to be recovered on use.
	 */
	private void setRestoreValue(int restoreValue) {
		
		this.restoreValue = restoreValue;
	}
	
	/**
	 * Gets the amount of mana to be recovered on use.
	 * @return The amount of mana to be recovered on use.
	 */ 
	private int getRestoreValue() {
		
		return this.restoreValue;
	}
}
